var app = angular.module('ZJPC');
app.controller('MonitorMenu', ['$scope','$state','$rootScope','$uibModal','CesiumService', 'ModalService',MonitorMenu]);


function MonitorMenu ($scope,$state,$rootScope,$uibModal,CesiumService,ModalService) {
    // console.log(112)
    var data = ['1.mp4','2.mp4'];
    var checkedView = '';
    $scope.openModal = ModalService.openModal;
    // $scope.openModal(checkedView);


    CesiumService.clickThings();

}

//模态框对应的Controller
app.controller('modalCtrl', ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) {
    // $scope.data= data;
    //在这里处理要进行的操作
    $scope.ok = function() {
      $uibModalInstance.close();
    };
    $scope.cancel = function() {
      $uibModalInstance.dismiss('cancel');
    }

    /*****实时预览******/
  var previewXml = '<?xml version="1.0" encoding="UTF-8"?>    <Message>     <Camera>        <Id>377</Id>        <IndexCode>33000000001310016872</IndexCode>       <Name>校大门球机1</Name>       <ChanNo>0</ChanNo>        <Matrix Code="0" Id="0" />      </Camera>     <Dev regtype="0" devtype="10011">       <Id>113</Id>        <IndexCode>33000000001310924041</IndexCode>       <Addr IP="172.16.2.112 " Port="8000" />        <Auth User="admin" Pwd="12345" />     </Dev>      <Vag IP="10.0.13.178 " Port="7302" />      <Voice>       <Encode>1</Encode>      </Voice>      <Media Protocol="0" Stream="0">       <Vtdu IP="10.0.13.180 " Port="554" />        <NetZoneId id="100001" />     </Media>      <Privilege Priority="51" Code="30" />     <Option>        <Talk>1</Talk>        <PreviewType>0</PreviewType>      </Option>   </Message>';

  $scope.startPlayView = function() {
    var OCXobj = document.getElementById("PlayViewOCX");
    // var previewXml = document.getElementById("config").value;
    console.log(previewXml);
    var ret = OCXobj.StartTask_Preview_InWnd(previewXml,0);
  }

  function init(){
    var OCXobj = document.getElementById("PlayViewOCX");
    OCXobj.SetOcxMode(0);
  }
  init();
}]);

